<?php
require "model/kid.model.php";
session_start();
if(isset($_SESSION['username'])){
$explanation = $_POST["content"];
$king = $_POST["king"];
$tr = kidList::addkid($king,$explanation);

if($tr){
    
    echo "<script>alert('分类添加成功');parent.location.href='./addkid2.php';</script>";
 }
 else{
  
    echo "<script>alert('添加分类失败');parent.location.href='./addkid2.php';</script>";
 }

}else{
    header("Location:../log.php");
      exit();
}